#! /usr/bin/python

# 引入GPIO模块
import RPi.GPIO as GPIO
import time

# 指定编码方式 + 关闭警告信息
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)

# 设置输出引脚
led_pin = 4

# 设置输出模式
GPIO.setup(led_pin, GPIO.OUT)

# 控制灯亮灭, 间隔 2s
while True:
    GPIO.output(led_pin, GPIO.LOW)
    print("LOW")
    time.sleep(1)
    GPIO.output(led_pin, GPIO.HIGH)
    print("HIGH")
    time.sleep(1)
